From 2d2a310ebe47f80710e6e421ee242aad5b14d17e Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Wed, 21 Dec 2005 08:40:16 -0600 Subject: [PATCH] Fix smp_processor_id to be linked to correct processor id under vcpu, which is the exact one updated by scheduler. Or else easy to think how things get messed under SMP environment. One phenomenon observed is about softirq. Exit path on CPU1 checks pending indicator by local_cpu_data, and then goto do_softirq if pending true. However do_softirq uses cpu_data(cpu) to query pending bit again. Cpu index is aquired from smp_processor_id, with thread_info->cpu not cared by scheduler. Finally do_softirq on CPU1 tries to operate percpu data on CPU0 then. Also disable several prints within critical path, like sending IPI. Due to slow serial speed, this will slow down overall performance heavily since event channels among CPUs are in traffic. This patch is necessary for host SMP. Signed-off-by Kevin Tian --- xen/arch/ia64/linux-xen/irq_ia64.c | 2 +- xen/arch/ia64/linux-xen/smp.c | 2 +- xen/arch/ia64/vmx/vmx_irq_ia64.c | 3 --- xen/include/asm-ia64/config.h | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/xen/arch/ia64/linux-xen/irq_ia64.c b/xen/arch/ia64/linux-xen/irq_ia64.c index c036ed08ee..346de4c167 100644 --- a/xen/arch/ia64/linux-xen/irq_ia64.c +++ b/xen/arch/ia64/linux-xen/irq_ia64.c @@ -282,7 +282,7 @@ ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect) ipi_addr = ipi_base_addr + ((phys_cpu_id << 4) | ((redirect & 1) << 3)); #ifdef XEN - printf ("send_ipi to %d (%x)\n", cpu, phys_cpu_id); + //printf ("send_ipi to %d (%x)\n", cpu, phys_cpu_id); #endif writeq(ipi_data, ipi_addr); } diff --git a/xen/arch/ia64/linux-xen/smp.c b/xen/arch/ia64/linux-xen/smp.c index bc8efb0ce6..97f66a045c 100644 --- a/xen/arch/ia64/linux-xen/smp.c +++ b/xen/arch/ia64/linux-xen/smp.c @@ -73,7 +73,7 @@ void smp_send_event_check_mask(cpumask_t mask) if (cpus_empty(mask)) return; - printf("smp_send_event_check_mask called\n"); + //printf("smp_send_event_check_mask called\n"); for (cpu = 0; cpu < NR_CPUS; ++cpu) if (cpu_isset(cpu, mask)) diff --git a/xen/arch/ia64/vmx/vmx_irq_ia64.c b/xen/arch/ia64/vmx/vmx_irq_ia64.c index 0bceaa82fd..331ad83d1e 100644 --- a/xen/arch/ia64/vmx/vmx_irq_ia64.c +++ b/xen/arch/ia64/vmx/vmx_irq_ia64.c @@ -117,9 +117,6 @@ vmx_ia64_handle_irq (ia64_vector vector, struct pt_regs *regs) local_irq_disable(); ia64_setreg(_IA64_REG_CR_TPR, saved_tpr); } - else { - printf("Oops: RESCHEDULE IPI absorbed by HV\n"); - } ia64_eoi(); vector = ia64_get_ivr(); } diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index 53c29dbeb9..4d730b4b1a 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -300,7 +300,7 @@ extern int ht_per_core; // needed for include/xen/smp.h #ifdef CONFIG_SMP -#define __smp_processor_id() current_thread_info()->cpu +#define __smp_processor_id() current->processor #else #define __smp_processor_id() 0 #endif -- 2.30.2